'use strict';

/**
 * @ngdoc service
 * @name webApp.browser
 * @description
 * # browser
 * Factory in the webApp.
 */
angular.module('webApp')
  .factory('browser', function () {
  var clientWidth = document.body.clientWidth; //网页可见区域宽
  var clientHeight = document.body.clientHeight; //网页可见区域高
  var offsetWidth = document.body.offsetWidth; //网页可见区域宽,包括边线和滚动条的宽
  var offsetHeight = document.body.offsetHeight;//网页可见区域高,包括边线的宽
  var scrollWidth = document.body.scrollWidth;//网页正文全文宽
  var scrollHeight = document.body.scrollHeight;//网页正文全文高
  var screenH = window.screen.height;//屏幕分辨率的高
  var screenW = window.screen.width;//屏幕分辨率的宽
  var availHeight = window.screen.availHeight;//屏幕可用工作区高度
  var availWidth = window.screen.availWidth;//屏幕可用工作区宽度
  var factory = [
    clientWidth,
    clientHeight,
    offsetWidth,
    offsetHeight,
    scrollWidth,
    scrollHeight,
    screenH,
    screenW,
    availHeight,
    availWidth
  ];
  return{
    factory :function(){
      return factory;
    }
  }
});
